home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 007a / cug315.zip / SOUND.TXT < prev    next >
Text File  |  1990-05-16  |  3KB  |  99 lines

  1.  
  2. DOCUMENTATION FOR SOUND.C
  3.  
  4. Documentation dated 8/89.
  5. Copyright (c) 1989, E.R.I.  All rights reserved.
  6.  
  7. INTRODUCTION
  8.      SOUND.C is the source file for using the 8253 counter timer chip on the IBM
  9. PC and compatibles.  The chip is used to generate sound on the computer's
  10. speaker and to time intervals.  The sound is defined from approximately 20 Hz to
  11. approximately 16 KHz.  The timer returns time in 1/100ths of seconds, but time
  12. is only resolved to 1/18.2ths of a second.  You should think of the maximum
  13. resolution as 1/20th second (0.05 sec).  Most of the functions in this file are
  14. just calls to sound() with hard-wired frequency and duration arguments, so I
  15. don't have to remember what frequency I use for a given alerting signal.
  16.  
  17. SOUND.C EXTERNALLY-VISIBLE FUNCTIONS
  18.      The externally-visible functions in SOUND.C are declared in the header file
  19. sound.h.  You should always include that file in programs that use these
  20. functions.
  21.  
  22. FUNCTION: alternate_warning_sound()
  23. TYPE: void
  24. ARGUMENTS: none.
  25.  
  26.      alternate_warning_sound() generates a tone appropriate for alerting users
  27. to some condition.
  28.  
  29.  
  30.  
  31. FUNCTION: beep_beep()
  32. TYPE: void
  33. ARGUMENTS: none.
  34.  
  35.      beep_beep() produces a double beep, and is useful as a "positive
  36. reinforcement" signal.
  37.  
  38.  
  39.  
  40. FUNCTION: blaat()
  41. TYPE: void
  42. ARGUMENTS: none.
  43.  
  44.      blaat() is a low, irritating sound that we use as the "wrong answer"
  45. signal.
  46.  
  47.  
  48.  
  49. FUNCTION: error_msg()
  50. TYPE: void
  51. ARGUMENTS:none.
  52.  
  53.      error_msg() is a generic prompt with sound effects that says that a given
  54. entry was inappropriate.
  55.  
  56.  
  57.  
  58. FUNCTION: mouse_warning_sound()
  59. TYPE: void
  60. ARGUMENTS: none.
  61.  
  62.      mouse_warning_sound() is the tone I generate in menu.c when the user holds
  63. a mouse button down when he should release it.
  64.  
  65.  
  66.  
  67. FUNCTION: pause()
  68. TYPE: void
  69. ARGUMENTS: one double.
  70.  
  71.      pause(duration) pauses duration seconds.
  72.  
  73.  
  74.  
  75. FUNCTION: read_timer()
  76. TYPE: unsigned long int
  77. ARGUMENTS: none.
  78.  
  79.      read_timer() returns the time of day in hundredths of a second.  Remember,
  80. the reading is not good to better than 1/20th second, but the formnat is
  81. hundredths.  Thus, a returned value of 1200 would be 12 seconds after midnight,
  82. etc.
  83.  
  84.  
  85.  
  86. FUNCTION: ready_beep()
  87. TYPE: void
  88. ARGUMENTS: none.
  89.  
  90.      ready_beep() produces a quick alerting beep.
  91.  
  92.  
  93.  
  94. FUNCTION: sound()
  95. TYPE: void
  96. ARGUMENTS: one unsigned int and one double.
  97.  
  98.      sound(freq, duration) produces a sound of freq frequency for duration
  99. seconds on the computer's speaker.